home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
slock
/
slock.hpp
< prev
next >
Wrap
C/C++ Source or Header
|
1998-09-28
|
7KB
|
178 lines
// Borland C++ Builder
// Copyright (c) 1995, 1998 by Borland International
// All rights reserved
// (DO NOT EDIT: machine generated header) 'Slock.pas' rev: 3.00
#ifndef SlockHPP
#define SlockHPP
#include <SlokUtil.hpp>
#include <ExtCtrls.hpp>
#include <Registry.hpp>
#include <StdCtrls.hpp>
#include <Dialogs.hpp>
#include <Controls.hpp>
#include <Graphics.hpp>
#include <Classes.hpp>
#include <SysUtils.hpp>
#include <Messages.hpp>
#include <Windows.hpp>
#include <SysInit.hpp>
#include <System.hpp>
//-- user supplied -----------------------------------------------------------
namespace Slock
{
//-- type declarations -------------------------------------------------------
typedef char *PBuffer;
enum TProtectionType { ptNone, ptExpiryDate, ptStartCount, ptDayCount, ptDaysUsed, ptTimed };
enum TStatus { stNotExpired, stGrace, stExpired, stRegistered };
enum TMachineOptions { moWinProdId, moWinRegOrg, moWinRegOwner, moVolSerial, moVolLabel, moExtensions
};
typedef Set<TMachineOptions, moWinProdId, moExtensions> TMachineOpt;
enum TProtectionOptions { poBack, poDLL };
typedef Set<TProtectionOptions, poBack, poDLL> TProtOpt;
enum TRegRoot { CURRENT_USER, CLASSES_ROOT, LOCAL_MACHINE, USERS, CURRENT_CONFIG, DYN_DATA };
struct TRegInfo
{
System::AnsiString RegName;
System::AnsiString ChallString;
System::AnsiString RegCode;
int StartsLeft;
int GracePeriod;
int Extension;
System::TDateTime ExpiryDate;
System::TDateTime UpdateDate;
} ;
class DELPHICLASS TSlock;
class PASCALIMPLEMENTATION TSlock : public Classes::TComponent
{
typedef Classes::TComponent inherited;
private:
Registry::TRegistry* Reg;
Extctrls::TTimer* Timer;
TProtectionType FProtectionType;
TProtOpt FProtOpt;
TRegInfo FRegInfo;
TStatus FStatus;
TMachineOpt FMachineOpt;
TRegRoot FKeyMainRoot;
TRegRoot FKeyBackRoot;
System::AnsiString FKeyMainPath;
System::AnsiString FKeyBackPath;
System::AnsiString FKeyMainKey;
System::AnsiString FKeyBackKey;
System::AnsiString FEncKey;
System::AnsiString FDLLName;
bool FIsRegistered;
Classes::TNotifyEvent FFirstStart;
Classes::TNotifyEvent FClockMovedBack;
Classes::TNotifyEvent FRegInfoTamper;
Classes::TNotifyEvent FRegInfoChanged;
Classes::TNotifyEvent FWrongUnlockCode;
Classes::TNotifyEvent FReminder;
Classes::TNotifyEvent FExpired;
Classes::TNotifyEvent FRegister;
Classes::TNotifyEvent FInGracePeriod;
Classes::TNotifyEvent FRegWriteErr;
Classes::TNotifyEvent FExtend;
Classes::TNotifyEvent FTimedOut;
void __fastcall SetProtectionType(TProtectionType Value);
void __fastcall SetStatus(TStatus Value);
void __fastcall SetIsRegistered(bool Value);
void __fastcall SetRegName(System::AnsiString Value);
void __fastcall SetEncKey(System::AnsiString Value);
System::AnsiString __fastcall GetChallengeString(void);
int __fastcall CheckUnlockString(System::AnsiString UnlockToTest);
int __fastcall GetRegInfo(void);
void __fastcall PutRegInfo(void);
int __fastcall GetActionType(void);
bool __fastcall CompareInfoCopies(const TRegInfo &MainCopy, const TRegInfo &BackCopy);
bool __fastcall FindDLL(void);
void __fastcall ReadDLLData(Byte * Buffer);
void __fastcall WriteDLLData(const Byte * Buffer);
bool __fastcall ParseBuffer(const Byte * Buffer, TRegInfo &RegInfoCopy);
void __fastcall NagRegister(void);
void __fastcall TimedOut(System::TObject* Sender);
System::AnsiString __fastcall GetAppPath(void);
int __fastcall GetRoot(TRegRoot RootKey);
protected:
void __fastcall DoFirstStart(void);
void __fastcall DoClockMovedBack(void);
void __fastcall DoRegistryTamper(void);
void __fastcall DoRegInfoChanged(void);
void __fastcall DoWrongUnlockCode(void);
void __fastcall DoReminder(void);
void __fastcall DoExpired(void);
void __fastcall DoRegister(void);
void __fastcall DoInGracePeriod(void);
void __fastcall DoRegWriteErr(void);
void __fastcall DoExtend(void);
void __fastcall DoTimedOut(void);
public:
void __fastcall CheckProtection(void);
void __fastcall RegisterNow(System::AnsiString UnlockString);
void __fastcall DeleteRegInfo(void);
System::AnsiString __fastcall GetVersion(void);
__fastcall virtual TSlock(Classes::TComponent* aOwner);
__fastcall virtual ~TSlock(void);
__published:
__property System::AnsiString ChallengeString = {read=FRegInfo.ChallString, write=FRegInfo.ChallString
};
__property System::AnsiString DLLName = {read=FDLLName, write=FDLLName};
__property System::AnsiString EncryptionKey = {read=FEncKey, write=SetEncKey};
__property System::TDateTime ExpiryDate = {read=FRegInfo.ExpiryDate, write=FRegInfo.ExpiryDate};
__property int GracePeriod = {read=FRegInfo.GracePeriod, write=FRegInfo.GracePeriod, nodefault};
__property TMachineOpt MachineOptions = {read=FMachineOpt, write=FMachineOpt, nodefault};
__property TProtOpt ProtectionOpt = {read=FProtOpt, write=FProtOpt, nodefault};
__property TProtectionType ProtectionType = {read=FProtectionType, write=SetProtectionType, nodefault
};
__property bool Registered = {read=FIsRegistered, write=SetIsRegistered, nodefault};
__property TRegRoot RegKeyMainRoot = {read=FKeyMainRoot, write=FKeyMainRoot, nodefault};
__property TRegRoot RegKeyBackRoot = {read=FKeyBackRoot, write=FKeyBackRoot, nodefault};
__property System::AnsiString RegKeyMainPath = {read=FKeyMainPath, write=FKeyMainPath};
__property System::AnsiString RegKeyBackPath = {read=FKeyBackPath, write=FKeyBackPath};
__property System::AnsiString RegKeyMainKey = {read=FKeyMainKey, write=FKeyMainKey};
__property System::AnsiString RegKeyBackKey = {read=FKeyBackKey, write=FKeyBackKey};
__property System::AnsiString RegName = {read=FRegInfo.RegName, write=SetRegName};
__property TStatus Status = {read=FStatus, write=SetStatus, nodefault};
__property int TrialPeriod = {read=FRegInfo.StartsLeft, write=FRegInfo.StartsLeft, nodefault};
__property Classes::TNotifyEvent OnClockMovedBack = {read=FClockMovedBack, write=FClockMovedBack};
__property Classes::TNotifyEvent OnExpired = {read=FExpired, write=FExpired};
__property Classes::TNotifyEvent OnExtend = {read=FExtend, write=FExtend};
__property Classes::TNotifyEvent OnFirstStart = {read=FFirstStart, write=FFirstStart};
__property Classes::TNotifyEvent OnInGracePeriod = {read=FInGracePeriod, write=FInGracePeriod};
__property Classes::TNotifyEvent OnRegInfoTamper = {read=FRegInfoTamper, write=FRegInfoTamper};
__property Classes::TNotifyEvent OnRegister = {read=FRegister, write=FRegister};
__property Classes::TNotifyEvent OnRegWriteErr = {read=FRegWriteErr, write=FRegWriteErr};
__property Classes::TNotifyEvent OnRegInfoChanged = {read=FRegInfoChanged, write=FRegInfoChanged};
__property Classes::TNotifyEvent OnReminder = {read=FReminder, write=FReminder};
__property Classes::TNotifyEvent OnWrongUnlockCode = {read=FWrongUnlockCode, write=FWrongUnlockCode
};
__property Classes::TNotifyEvent OnTimedOut = {read=FTimedOut, write=FTimedOut};
};
//-- var, const, procedure ---------------------------------------------------
extern PACKAGE void __fastcall Register(void);
} /* namespace Slock */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Slock;
#endif
//-- end unit ----------------------------------------------------------------
#endif // Slock